import time
from Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    # 点击登录
    denglu=(By.XPATH,'//*[@id="ttbar-login"]/a[1]')
    def denglu_loc(self):
        self.click(self.denglu)
    #     点击密码登录
    dianjimima=(By.ID,'pwd-login')
    def dianji_loc(self):
        self.click(self.dianjimima)
    #  输入用户名
    name = (By.NAME, 'loginname')
    def name_loc(self):
        self.send_keys(self.name, '18379340028')
    # 输入密码
    mima=(By.XPATH,'//*[@id="nloginpwd"]')
    def mima_loc(self):
        self.send_keys(self.mima,'002816hj')
    # 点击立即登录
    anniu=(By.XPATH,'//*[@id="loginsubmit"]')
    def anniu_loc(self):
        self.click(self.anniu)

    def baidu(self):
        self.open('https://www.jd.com/')
        self.denglu_loc()
        time.sleep(2)
        self.dianji_loc()
        time.sleep(2)
        self.name_loc()
        self.mima_loc()
        time.sleep(2)
        self.anniu_loc()
        time.sleep(10)

